var _ip = "10.10.2.33:8081"; // 调用ajax systemproperty查询的servlet获取 address.webreport的值

var prop_src = "";
function getProp(){
    var prop_arr = ["report.web.flow.statistics","report.voip.flow.statistics","report.general.flow.statistics","report.visit.app.statistics","report.illegal.route.analysis","report.share.detect.analysis","report.ddos.app.attack","report.cp.sp.resource.analysis","report.flow.direction.analysis","report.web.msg.send.result.report","report.udlog.browse","report.wlanreport"];
    // $.post("/WebManage/action/system/getlistproperty.do",{property:JSON.stringify(prop_arr)},function(data){
    //     prop_src = JSON.parse(data);
    // });
    $.ajax({
        "method": "POST",
        "async": false,
        "url": "/action/system/getlistproperty.do",
        data: {property:JSON.stringify(prop_arr)},
        success: function(resp) {
            prop_src = JSON.parse(resp);
        }
    });
}

getProp();

function urlProxy(key) {
    var dstURL = "#";
    $.each(prop_src,function(i,e){
        var t = prop_src[i][key];
        if( t != undefined){
            dstURL = t;
        }
    });
    return dstURL;
}

var nav = [
    {
        name: "设备管理",
        type: "dir",
        picture: "icon-desktop",
        icon: "/WebManage/assets/js/plugin/tree/img/diy/close.png",
        iconOpen: "/WebManage/assets/js/plugin/tree/img/diy/open.png",
        iconClose: "/WebManage/assets/js/plugin/tree/img/diy/close.png",
        path: "device/device-list.html",
        children: [
            {
                id: "dpi",
                name: "DPI 设备管理",
                type: "file",
                path: "device/dpi-device-list.html?type=",
                children: []
            },
            {
                id: "eu",
                name: "EU 设备管理",
                type: "file",
                path: "device/eu-device-list.html?type=",
                children: []
            },
            {
                id: "ud",
                name: "UD 采集设备管理",
                type: "file",
                path: "device/udCollection-device-list.html?type=",
                children: []
            },
            {
                id: "ud",
                name: "UD 上报设备管理",
                type: "file",
                path: "device/udReported-device-list.html?type=",
                children: []
            },
             {
                id: "ud",
                name: "DPI/EU UD 部署管理",
                type: "file",
                path: "device/devDeploy-device-list.html?type=",
                children: []
            },
            {
                id: "td",
                name: "TD 设备管理",
                type: "file",
                path: "device/td-device-list.html?type=",
                children: []
            }
//            ,
//            {
//                id: "td",
//                name: "设备拓扑图",
//                type: "file",
//                path: "device/char.html?type=",
//                children: []
//            }
        ]
    },
    {
        name: "策略库管理",
        type: "dir",
        picture: "icon-list",
        icon: "/WebManage/assets/js/plugin/tree/img/diy/close.png",
        iconOpen: "/WebManage/assets/js/plugin/tree/img/diy/open.png",
        iconClose: "/WebManage/assets/js/plugin/tree/img/diy/close.png",
        children: [
            {
                name: "针对应用类",
                type: "dir",
                children: [
                    {
                        id: "0x00",
                        name: "通用参数设置",
                        type: "file",
                        path: "policyDepot/policyDepot-list.html?type=",
                        children: []
                    },
                    {
                        id: "0x01",
                        name: "流量分析结果上报",
                        type: "file",
                        path: "policyDepot/policyDepot-list.html?type=",
                        children: []
                    },
                    {
                        id: "0x02",
                        name: "Web类流量管理",
                        type: "file",
                        path: "policyDepot/policyDepot-list.html?type=",
                        children: []
                    },
                    {
                        id: "0x05",
                        name: "Voip类流量管理",
                        type: "file",
                        path: "policyDepot/policyDepot-list.html?type=",
                        children: []
                    },
                    {
                        id: "0x06",
                        name: "通用流量管理",
                        type: "file",
                        path: "policyDepot/policyDepot-list.html?type=",
                        children: []
                    },
                    {
                        id: "0x07",
                        name: "通用流量标记",
                        type: "file",
                        path: "policyDepot/policyDepot-list.html?type=",
                        children: []
                    },
                    {
                        id: "0x08",
                        name: "访问指定应用的用户统计",
                        type: "file",
                        path: "policyDepot/policyDepot-list.html?type=",
                        children: []
                    },
                    {
                        id: "0x09",
                        name: "流量镜像",
                        type: "file",
                        path: "policyDepot/policyDepot-list.html?type=",
                        children: []
                    },
                    {
                        id: "0x0A",
                        name: "应用自定义",
                        type: "file",
                        path: "policyDepot/policyDepot-list.html?type=",
                        children: []
                    }
                ]
            },
            {
                name: "针对用户类",
                type: "dir",
                children: [
                    {
                        id: "0x40",
                        name: "用户组归属分配",
                        type: "file",
                        path: "policyDepot/policyDepot-list.html?type=",
                        children: []
                    },
                    {
                        id: "0x41",
                        name: "Web信息推送",
                        type: "file",
                        path: "policyDepot/policyDepot-list.html?type=",
                        children: []
                    },
                    {
                        id: "0x42",
                        name: "一拖N用户管理",
                        type: "file",
                        path: "policyDepot/policyDepot-list.html?type=",
                        children: []
                    },
                    {
                        id: "0x43",
                        name: "应用层DDos异常流量管理",
                        type: "file",
                        path: "policyDepot/policyDepot-list.html?type=",
                        children: []
                    },
                    {
                        id: "0x45",
                        name: "流量流向区域同步对象管理",
                        type: "file",
                        path: "policyDepot/policyDepot-list.html?type=",
                        children: []
                    }
                ]
            },
            {
                name: "用户/应用绑定类",
                type: "dir",
                children: [
                    {
                        id: "0x85",
                        name: "用户/应用策略信息下发",
                        type: "file",
                        path: "policyDepot/policyDepot-list.html?type=",
                        children: []
                    },
                    {
                        id: "0x82",
                        name: "IP地址段用户信息下发",
                        type: "file",
                        path: "policyDepot/policyDepot-list.html?type=",
                        children: []
                    }
                ]
            },
            {
                name: "通用设置类",
                type: "dir",
                children: [
                    {
                        id: "0xC4",
                        name: "DPI设备状态查询请求",
                        type: "file",
                        path: "policyDepot/policyDepot-list.html?type=",
                        children: []
                    },
                    {
                        id: "0xC7",
                        name: "协议特征库管理",
                        type: "file",
                        path: "policyDepot/policyDepot-list.html?type=",
                        children: []
                    },
                    {
                        id: "0xC8",
                        name: "Web分类库管理",
                        type: "file",
                        path: "policyDepot/policyDepot-list.html?type=",
                        children: []
                    },
                    {
                        id: "0xC9",
                        name: "应用名称对应表管理",
                        type: "file",
                        path: "policyDepot/policyDepot-list.html?type=",
                        children: []
                    },
                    {
                        id: "0xCA",
                        name: "IP地址库管理",
                        type: "file",
                        path: "policyDepot/policyDepot-list.html?type=",
                        children: []
                    },
                    {
                        id: "0xCF",
                        name: "HTTP GET报文清洗黑白名单管理",
                        type: "file",
                        path: "policyDepot/policyDepot-list.html?type=",
                        children: []
                    },
                    {
                        id: "0xCB",
                        name: "信息推送触发网站列表定义",
                        type: "file",
                        path: "policyDepot/policyDepot-list.html?type=",
                        children: []
                    },
                    {
                        id: "0xCC",
                        name: "信息推送触发关键字列表定义",
                        type: "file",
                        path: "policyDepot/policyDepot-list.html?type=",
                        children: []
                    }
                ]
            }
        ]
    },
    {
        name: "通用文件管理",
        type: "dir",
        picture: "icon-folder-open",
        icon: "/WebManage/assets/js/plugin/tree/img/diy/close.png",
        iconOpen: "/WebManage/assets/js/plugin/tree/img/diy/open.png",
        iconClose: "/WebManage/assets/js/plugin/tree/img/diy/close.png",
        children: [
            {
                name: "协议特征库管理",
                type: "file",
                path: "generalFile/upload_protocol_bank.html",
                children: []
            },
            {
                name: "Web分类库管理",
                type: "file",
                path: "generalFile/web.html",
                children: []
            },
            {
                name: "应用名称对应表管理",
                type: "file",
                path: "generalFile/app.html",
                children: []
            },
            {
                name: "IP地址库管理",
                type: "file",
                path: "generalFile/ip.html",
                children: []
            },
            {
                name: "HTTP GET报文清洗域名黑名单管理",
                type: "file",
                path: "generalFile/black_domain_list.html",
                children: []
            },
            {
                name: "HTTP GET报文清洗URL黑名单管理",
                type: "file",
                path: "generalFile/black_url_list.html",
                children: []
            },
            {
                name: "HTTP GET报文清洗域名白名单管理",
                type: "file",
                path: "generalFile/white_list.html",
                children: []
            }
        ]
    },
    {
        name: "策略下发队列",
        type: "file",
        picture: "icon-list-alt",
        icon: "/WebManage/assets/js/plugin/tree/img/diy/close.png",
        iconOpen: "/WebManage/assets/js/plugin/tree/img/diy/open.png",
        iconClose: "/WebManage/assets/js/plugin/tree/img/diy/close.png",
        path: "issuedList/issued-list.html",
        children: []
    },
    {
        name: "报表查看",
        type: "dir",
        picture: "icon-bar-chart",
        icon: "/WebManage/assets/js/plugin/tree/img/diy/close.png",
        iconOpen: "/WebManage/assets/js/plugin/tree/img/diy/open.png",
        iconClose: "/WebManage/assets/js/plugin/tree/img/diy/close.png",
        children: [
            {
                name: "Web 类流量统计",
                type: "file",
                path: urlProxy("report.web.flow.statistics"),
                children: []
            },
            {
                name: "VoIP 类流量统计",
                type: "file",
                path: urlProxy("report.voip.flow.statistics"),
                children: []
            },
            {
                name: "通用类流量统计",
                type: "file",
                path: urlProxy("report.general.flow.statistics"),
                children: []
            },
            {
                name: "访问指定应用的用户统计",
                type: "file",
                path: urlProxy("report.visit.app.statistics"),
                children: []
            },
//            {
//                name: "用户偏好分析",
//                type: "file",
//                path: "",
//                children: []
//            },
            {
                name: "非法路由检测分析",
                type: "file",
                path: urlProxy("report.illegal.route.analysis"),
                children: []
            },
//            {
//                name: "一拖 N 用户行为分析（检测结果）",
//                type: "file",
//                path: "",
//                children: []
//            },
            {
                name: "一拖 N 用户行为分析（关键字段）",
                type: "file",
                path: urlProxy("report.share.detect.analysis"),
                children: []
            },
            {
                name: "Web 信息推送结果上报",
                type: "file",
                path: urlProxy("report.web.msg.send.result.report"),
                children: []
            },
            {
                name: "应用层 DDoS 异常流量分析功能模块",
                type: "file",
                path: urlProxy("report.ddos.app.attack"),
                children: []
            },
            {
                name: "CP/SP 资源服务器分析模块",
                type: "file",
                path: urlProxy("report.cp.sp.resource.analysis"),
                children: []
            },
            {
                name: "流量流向分析结果上报",
                type: "file",
                path: urlProxy("report.flow.direction.analysis"),
                children: []
            },
//            {
//                name: "HTTP GET 报文关键字段上报",
//                type: "file",
//                path: "",
//                children: []
//            },
            {
                name: "移动终端类型上报",
                type: "file",
                path: urlProxy("report.wlanreport"),
                children: []
            },
            {
                name: "UD日志查询",
                type: "file",
                path: urlProxy("report.udlog.browse"),
                children: []
            }
        ]
    },
    {
        name: "用户管理",
        type: "file",
        picture: "icon-user",
        icon: "/WebManage/assets/js/plugin/tree/img/diy/close.png",
        iconOpen: "/WebManage/assets/js/plugin/tree/img/diy/open.png",
        iconClose: "/WebManage/assets/js/plugin/tree/img/diy/close.png",
        path: "user/user-list.html",
        children: []
    },
    {
        name: "系统日志",
        picture: "icon-book",
        icon: "/WebManage/assets/js/plugin/tree/img/diy/close.png",
        iconOpen: "/WebManage/assets/js/plugin/tree/img/diy/open.png",
        iconClose: "/WebManage/assets/js/plugin/tree/img/diy/close.png",
        type: "dir",
        children: [
            {
                name: "策略接收日志",
                type: "file",
                path: "log/policyReceiveLog.html",
                children: []
            },
            {
                name: "策略下发日志",
                type: "file",
                path: "log/policySendLog.html",
                children: []
            },
            {
                name: "TD系统日志",
                type: "file",
                path: "log/systemLog-td.html",
                children: []
            },
            {
                name: "用户操作日志",
                type: "file",
                path: "log/userLog.html",
                children: []
            },
            {
                name: "系统日志",
                type: "file",
                path: "log/systemLog.html",
                children: []
            },
            {
                name: "系统配置",
                type: "file",
                path: "log/systemConfig.html",
                children: []
            }
        ]
    }
]


